class ShapeEvent {
    /**
     * @description 事件存储
     * @type {Map<string,(...args)=>void>}
     */
    listeners = new Map();
  
    /**
     * @description 添加事件
     * @param {string} type
     * @param {(...args)=>void} callback
     */
    add(type, callback) {
      this.listeners.set(type, callback);
    }
  
    /**
     * @description 移除事件
     * @param {string} type
     */
    remove(type) {
      this.listeners.delete(type);
    }
  
    /**
     * @description 触发事件
     * @param {string} type
     * @param  {...any} args
     */
    emit(type, ...args) {
      const listener = this.listeners.get(type);
      if (listener) {
        listener(...args);
      }
    }
  }
  